home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / daybat10.zip / DAYBAT.PAS < prev    next >
Pascal/Delphi Source File  |  1989-02-08  |  2KB  |  80 lines

  1. (*
  2.  * Runs a different batch file each day
  3.  *
  4.  * By Joseph Sheppard, The Ledge PCBoard (818) 352-3620
  5.  *
  6.  * Shareware Material
  7.  *)
  8.  
  9.  
  10. {$M 16000,42000,42000}
  11. {$L-}
  12. {$V-}
  13.  
  14. program Newdoor;
  15.  
  16. uses
  17.  dos;
  18.  
  19. const
  20.    days: array[0..6] of string[3] =
  21.    ('SUN','MON','TUE','WED','THU','FRI','SAT');
  22.  
  23. var
  24.  
  25.  y,m,d,w:             word;
  26.  bat:               string;
  27.  
  28. (* ---------------------------------------------------------------- *)
  29. procedure show_help;
  30.  
  31. begin
  32.   writeln;
  33.   writeln('DAYBAT will run a different batch file every day of the week.');
  34.   writeln('The Batch files must be named with the first three letters of the day');
  35.   writeln('of the week followed by .BAT (Example: MON.BAT, TUES.BAT, etc.).  The');
  36.   writeln('batch files must be located in the DOS Path, or the same directory as');
  37.   Writeln('DAYBAT.EXE.  Run DAYBAT in your AUTOEXEC.BAT to activate a new batch');
  38.   Writeln('file each day!');
  39.   writeln;
  40.   writeln('DAYBAT is released under the Shareware concept.  If this program meets');
  41.   writeln('your needs, please send the author whatever you feel the program is worth.');
  42.   writeln('The suggested amount is $5.00.  Send contributions to:');
  43.   writeln;
  44.   writeln('          Joseph Sheppard');
  45.   writeln('          PO Box 10');
  46.   writeln('          Tujunga, CA 91042-0010');
  47. end;
  48.  
  49. (* ---------------------------------------------------------------- *)
  50. procedure run_bat;
  51.  
  52. begin
  53.   writeln;
  54.   writeln('<DAYBAT ?> for instructions');
  55.   writeln;
  56.   writeln('Executing ',bat);
  57.   writeln;
  58.   exec(getenv('COMSPEC'),'/c'+ bat);
  59.  
  60.  
  61. end;
  62.  
  63. (* ---------------------------------------------------------------- *)
  64.  
  65.  
  66. begin
  67.   writeln;
  68.   writeln('DAYBAT V1.0 by Joseph Sheppard, The Ledge PCBoard (818) 352-3620 - HST');
  69.   GetDate(y,m,d,w);
  70.   bat:=days[w]+'.BAT';
  71.   if paramstr(1)='?' then show_help;
  72.   if paramstr(1)<>'?' then run_bat;
  73.   writeln;
  74.  
  75.  
  76. end.
  77.  
  78.                             
  79.   
  80.